package homework;

import java.nio.charset.StandardCharsets;

public class HttpProtocolUtil {

    public static String getHttpHeader200(Integer lenth){
        return "HTTP/1.1 200 OK \n" +
                "Content-Type: text/html \n" +
                "Content-Length: " + lenth + "\n" +
                "\r\n";
    }

    public static String getHttpHeader404(){
        String str404 = "<h1>404 not found</h1>";
        return "HTTP/1.1 404 Not Found\n" +
                "Content-Type: text/html \n" +
                "Content-Length: " + str404.getBytes(StandardCharsets.UTF_8).length + "\n" +
                "\r\n" +  str404;
    }
}
